<template>
  <div class="main">
    <div class="child1"></div>
    <div class="child2"><h1>医院公告</h1></div>
  </div>
  <div class="fu">
    <ul v-for="d in types" :key="d" @click="goto(d.id)">
      <div class="title1">{{ d.title }}</div>
      <div class="day">{{ d.day }}</div>
      <el-divider class="day" border-style="dashed" />
    </ul>
  </div>
</template>

<script>
import { get } from "@/utils/request";
export default {
  data() {
    return {
      types: [],
    };
  },
  mounted() {
    get("/getNotice").then((res) => {
      this.types = res.data.data;
      console.log(this.types);
    });
  },
  methods: {
    goto(id) {
      this.$router.push({ name: "detail", params: { id } });
    },
  },
};
</script>

<style lang="scss" scoped>
html {
  margin: 0;
  padding: 0;
}
ul {
  margin: 0;
  padding: 0;
}
.child1 {
  background-color: #259b9e;
  height: 35px;
  width: 15px;
  float: left;
}

.main {
  margin-left: 10%;
  margin-top: 55px;
}
.title1 {
  float: left;
  size: 25px;
}
.day {
  float: right;
}
.fu {
  margin-right: 10%;
  margin-left: 10%;
  margin-top: 25px;
  cursor: pointer;
}
</style>
